﻿<%@ Page Title="" Language="C#" MasterPageFile="~/adminpanel.master" AutoEventWireup="true" CodeFile="Bonus.aspx.cs" Inherits="Web_Bonus" %>

<%@ Register assembly="DevExpress.Web.ASPxGridView.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">

    <dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSource1" KeyFieldName="User_id" 
        CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" CssPostfix="BlackGlass" 
        Width="100%" ClientIDMode="AutoID">
    <Columns>
        <dx:GridViewCommandColumn VisibleIndex="0">
            <ClearFilterButton Visible="True">
            </ClearFilterButton>
        </dx:GridViewCommandColumn>
        <dx:GridViewDataTextColumn Caption="User ID" FieldName="User_id" 
            FixedStyle="Left" ReadOnly="True" ShowInCustomizationForm="True" 
            VisibleIndex="1">
            <CellStyle BackColor="#C0CAD9">
            </CellStyle>

        </dx:GridViewDataTextColumn>
        <dx:GridViewDataComboBoxColumn Caption="User Status" FieldName="user_Status" 
            FixedStyle="Left" VisibleIndex="2">
            <PropertiesComboBox ValueType="System.String">
                <Items>
                    <dx:ListEditItem Text="5% Percenter" Value="2" />
                    <dx:ListEditItem Text="10% Presenter" Value="3" />
                    <dx:ListEditItem Text="15% Presenter" Value="4" />
                    <dx:ListEditItem Text="Agent" Value="5" />
                    <dx:ListEditItem Text="Ruby" Value="6" />
                    <dx:ListEditItem Text="Diamond" Value="7" />
                    <dx:ListEditItem Text="Senior Diamond" Value="8" />
                    <dx:ListEditItem Text="Senior Executive Diamond" Value="9" />
                    <dx:ListEditItem Text="Crown Diamond" Value="10" />
                    <dx:ListEditItem Text="2 Crown Diamond" Value="11" />
                    <dx:ListEditItem Text="3 Crown Diamond" Value="12" />
                    <dx:ListEditItem Text="4 Crown Diamond" Value="13" />
                    <dx:ListEditItem Text="5 Crown Diamond" Value="14" />
                </Items>
            </PropertiesComboBox>
            <CellStyle BackColor="#C0CAD9">
            </CellStyle>
        </dx:GridViewDataComboBoxColumn>
        <dx:GridViewDataTextColumn FieldName="T_sales" VisibleIndex="3" 
            Caption="Total Sales">
            <PropertiesTextEdit DisplayFormatString="Rs.{0}">
                <MaskSettings IncludeLiterals="DecimalSymbol" 
                    Mask="&lt;0..99999g&gt;.&lt;00..99&gt;" />
            </PropertiesTextEdit>
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="ppv" VisibleIndex="4" 
            Caption="Personal Point Value">
            <PropertiesTextEdit>
                <MaskSettings IncludeLiterals="DecimalSymbol" 
                    Mask="&lt;0..99999g&gt;.&lt;00..99&gt;" />
            </PropertiesTextEdit>
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="Bv" VisibleIndex="5" 
            Caption="Business Value">
            <PropertiesTextEdit>
                <MaskSettings IncludeLiterals="DecimalSymbol" 
                    Mask="&lt;0..99999g&gt;.&lt;00..99&gt;" />
            </PropertiesTextEdit>
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="Tpv" VisibleIndex="6" 
            Caption="Total Point Value">
            <PropertiesTextEdit>
                <MaskSettings IncludeLiterals="DecimalSymbol" 
                    Mask="&lt;0..99999g&gt;.&lt;00..99&gt;" />
            </PropertiesTextEdit>
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="Tbv" VisibleIndex="7" 
            Caption="Total Bussiness Value">
            <PropertiesTextEdit>
                <MaskSettings IncludeLiterals="DecimalSymbol" 
                    Mask="&lt;0..99999g&gt;.&lt;00..99&gt;" />
            </PropertiesTextEdit>
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="Cpv" VisibleIndex="8" 
            Caption="Cumilative Point Value">
            <PropertiesTextEdit>
                <MaskSettings IncludeLiterals="DecimalSymbol" 
                    Mask="&lt;0..99999g&gt;.&lt;00..99&gt;" />
            </PropertiesTextEdit>
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="T_commision" VisibleIndex="9" 
            Caption="Total Commision">
            <PropertiesTextEdit DisplayFormatString="Rs.{0}">
                <MaskSettings IncludeLiterals="DecimalSymbol" 
                    Mask="&lt;0..99999g&gt;.&lt;00..99&gt;" />
            </PropertiesTextEdit>
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="Lship_Status" VisibleIndex="10" 
            Caption="Leadership Bouns Status">
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="Store_pv" VisibleIndex="11">
            <PropertiesTextEdit>
                <MaskSettings IncludeLiterals="DecimalSymbol" 
                    Mask="&lt;0..99999g&gt;.&lt;00..99&gt;" />
            </PropertiesTextEdit>
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="Store_bv" VisibleIndex="12">
            <PropertiesTextEdit>
                <MaskSettings IncludeLiterals="DecimalSymbol" 
                    Mask="&lt;0..99999g&gt;.&lt;00..99&gt;" />
            </PropertiesTextEdit>
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="Store_comm" VisibleIndex="13">
            <PropertiesTextEdit>
                <MaskSettings IncludeLiterals="DecimalSymbol" 
                    Mask="&lt;0..99999g&gt;.&lt;00..99&gt;" />
            </PropertiesTextEdit>
        </dx:GridViewDataTextColumn>
    </Columns>
        <SettingsPager PageSize="25">
        </SettingsPager>
    <Settings ShowFilterRow="True" ShowHorizontalScrollBar="True" />
        <Images SpriteCssFilePath="~/App_Themes/BlackGlass/{0}/sprite.css">
            <LoadingPanelOnStatusBar Url="~/App_Themes/BlackGlass/GridView/gvLoadingOnStatusBar.gif">
            </LoadingPanelOnStatusBar>
            <LoadingPanel Url="~/App_Themes/BlackGlass/GridView/Loading.gif">
            </LoadingPanel>
        </Images>
        <ImagesFilterControl>
            <LoadingPanel Url="~/App_Themes/BlackGlass/Editors/Loading.gif">
            </LoadingPanel>
        </ImagesFilterControl>
        <Styles CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" 
            CssPostfix="BlackGlass">
            <Header ImageSpacing="5px" SortingImageSpacing="5px">
            </Header>
        </Styles>
        <StylesEditors>
            <CalendarHeader Spacing="1px">
            </CalendarHeader>
            <ProgressBar Height="25px">
            </ProgressBar>
        </StylesEditors>
</dx:ASPxGridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:BestlifeDBConnectionString %>" 
    DeleteCommand="DELETE FROM [Bonus] WHERE [User_id] = @User_id" 
    InsertCommand="INSERT INTO [Bonus] ([User_id], [Tpv], [ppv], [Cpv], [T_sales], [T_commision], [Bv], [user_Status], [Lship_Status], [Tbv], [Store_pv], [Store_bv], [Store_comm]) VALUES (@User_id, @Tpv, @ppv, @Cpv, @T_sales, @T_commision, @Bv, @user_Status, @Lship_Status, @Tbv, @Store_pv, @Store_bv, @Store_comm)" 
    SelectCommand="SELECT [User_id], [Tpv], [ppv], [Cpv], [T_sales], [T_commision], [Bv], [user_Status], [Lship_Status], [Tbv], [Store_pv], [Store_bv], [Store_comm] FROM [Bonus] ORDER BY  CAST (User_id as float)  ASC" 
    
        
        UpdateCommand="UPDATE [Bonus] SET [Tpv] = @Tpv, [ppv] = @ppv, [Cpv] = @Cpv, [T_sales] = @T_sales, [T_commision] = @T_commision, [Bv] = @Bv, [user_Status] = @user_Status, [Lship_Status] = @Lship_Status, [Tbv] = @Tbv, [Store_pv] = @Store_pv, [Store_bv] = @Store_bv, [Store_comm] = @Store_comm WHERE [User_id] = @User_id">
    <DeleteParameters>
        <asp:Parameter Name="User_id" Type="String" />
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter Name="User_id" Type="String" />
        <asp:Parameter Name="Tpv" Type="Decimal" />
        <asp:Parameter Name="ppv" Type="Decimal" />
        <asp:Parameter Name="Cpv" Type="Decimal" />
        <asp:Parameter Name="T_sales" Type="Decimal" />
        <asp:Parameter Name="T_commision" Type="Decimal" />
        <asp:Parameter Name="Bv" Type="Decimal" />
        <asp:Parameter Name="user_Status" Type="String" />
        <asp:Parameter Name="Lship_Status" Type="Decimal" />
        <asp:Parameter Name="Tbv" Type="Decimal" />
        <asp:Parameter Name="Store_pv" Type="Decimal" />
        <asp:Parameter Name="Store_bv" Type="Decimal" />
        <asp:Parameter Name="Store_comm" Type="Decimal" />
    </InsertParameters>
    <UpdateParameters>
        <asp:Parameter Name="Tpv" Type="Decimal" />
        <asp:Parameter Name="ppv" Type="Decimal" />
        <asp:Parameter Name="Cpv" Type="Decimal" />
        <asp:Parameter Name="T_sales" Type="Decimal" />
        <asp:Parameter Name="T_commision" Type="Decimal" />
        <asp:Parameter Name="Bv" Type="Decimal" />
        <asp:Parameter Name="user_Status" Type="String" />
        <asp:Parameter Name="Lship_Status" Type="Decimal" />
        <asp:Parameter Name="Tbv" Type="Decimal" />
        <asp:Parameter Name="Store_pv" Type="Decimal" />
        <asp:Parameter Name="Store_bv" Type="Decimal" />
        <asp:Parameter Name="Store_comm" Type="Decimal" />
        <asp:Parameter Name="User_id" Type="String" />
    </UpdateParameters>
</asp:SqlDataSource>

</asp:Content>

